import {
	defineStore
} from 'pinia'

import {
	ref
} from 'vue'

export const useUserStore = defineStore('user', () => {
	// 定义token
	const token = ref('')

	const userInfo = ref('')

	const memberInfo = ref('')
	
	const curretPage = ref('')

	// 响应式数据
	return {
		token,
		userInfo,
		memberInfo,
		curretPage
	}
}, {
	// persist:true 默认全部持久化
	persist: {
		paths: ['token', 'userInfo', 'memberInfo']
	},
})